// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   Popedom.java

package com.oa.document;

import com.oa.database.DataConn;
import com.oa.database.QueryData;
import com.oa.share.CheckPartner;
import java.io.PrintStream;
import java.sql.ResultSet;

public class Popedom
{

    private DataConn dataConn;
    private QueryData queryData;
    private String sTable;
    private String sField;
    private String sCond;
    private static boolean strVERSION_F = false;
    private static String strVERSION_M = "document==OAVER20050609";

    public static String getVERSION_M()
    {
        return strVERSION_M;
    }

    public Popedom()
    {
        dataConn = null;
        queryData = null;
        sTable = "";
        sField = "";
        sCond = "";
    }

    public boolean isManager(int userid, String QXMC)
    {
        ResultSet rs;
        dataConn = new DataConn();
        queryData = new QueryData(dataConn);
        sTable = "OA_GWQX";
        sField = "QXID";
        sCond = "QXMC='" + QXMC + "' and QXRY LIKE '%," + Integer.toString(userid) + ",%'";
        queryData.setMultRecordSet(sTable, sField, sCond);
        if(!strVERSION_F)
        {
            strVERSION_F = CheckPartner.isSameVersion(strVERSION_M);
            if(!strVERSION_F)
            {
                System.out.println("Version Error===" + strVERSION_M.substring(0, 15));
                return false;
            }
        }
        rs = queryData.getResultSet();
        try{
        if(!rs.next()){
        rs.getInt("QXID");
        return true;
        }}catch(Exception e){
        	
        }
        dataConn.close();
        return false;
    }

    public static void main(String args[])
    {
        Popedom popedom1 = new Popedom();
        System.out.println("here");
        try
        {
            System.out.println("IsManager=" + popedom1.isManager(31, "GUIDANG"));
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }

}
